

<?php
        $xcrud = Xcrud::get_instance();
        $xcrud->table('user');
        $xcrud->where('username =',$_SESSION['user']['username']);
        $xcrud->relation('level','user_group','group_id','group_title','group_level=4');
        $xcrud->change_type('password', 'password');
        // hide fields
        //$xcrud->fields('avatar,ngaysinh', true);
              // hide columns
        //  $xcrud->columns('password',true);
      
      
      //------- GRIDVIEW MODE ---------
      
        //Hide field in gridview
       
              
        //Change type to remote image -------
        $xcrud->change_type('avatar', 'remote_image');
        
        //---------ADD /EDIT MODE----------
       
       //Display field in edit/add mode with tab
       //Hide hash and password if user not admin group in add/edit mode :
                //  $xcrud->fields('password,hash', true);
                   $xcrud->fields('username,email,avatar,status,active,level,facebook,facebook_id', false, 'My Information');
				   	 $xcrud->fields('key1,key2,ref,scash,gift_used', false, 'Game information');  
                     $xcrud->fields('day_register,last_login,ip,ip_login,changepass', false, 'Other');
				
					  
					  
                   $xcrud->fields('password', false, 'Password');
                  
      

                 
              
        $xcrud->label(array('status'=>'Tình Trạng'));

      	$xcrud->readonly('email,username,level,last_login,day_register,last_login,status,level,ip');
		$xcrud->disabled('level');
		
		
        $xcrud->unset_remove();
        $xcrud->unset_add();
		$xcrud->unset_edit();
        $xcrud->unset_search();
        $xcrud->unset_csv();
        $xcrud->unset_print();
        $xcrud->unset_pagination();
        $xcrud->theme('bootstrap');
       $xcrud->table_name('My Account');
        
        echo $xcrud->render();

?>
